<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cr&eacute;ation d'un sondage - <fmt:message
	key="appTitle" /></title>
<link rel="stylesheet" type="text/css"
	href='<c:url value="/styles/base.css" />' />
<link rel="stylesheet" type="text/css"
	href='<c:url value="/styles/charte.css" />' />
</head>
<body>

<div id="global"><jsp:include page="header.jsp" /> <jsp:include
	page="menu.jsp" />

<div id="contenu">
<div id="gp">
<h2>Propri&eacute;t&eacute; du sondage <c:out
	value="${model.survey.title}" /></h2>
<table>
	<tr>
		<td><strong>Description :</strong></td>
		<td><c:out value="${model.survey.description}" /></td>
	</tr>
	<tr>
		<td><strong>Confidentialit&eacute; :</strong></td>
		<td><c:choose>
			<c:when test="${model.survey.confidentiality=='PRIVATE'}">Privé
			</c:when>
			<c:when test="${model.survey.confidentiality=='SEMIPRIVATE'}">Semi-privé
			</c:when>
			<c:otherwise>Public
			</c:otherwise>
		</c:choose></td>
	</tr>
	<tr>
		<td><strong>Statut :</strong></td>
		<td><c:choose>
			<c:when test="${model.survey.open}">Le sondage est ouvert.
			</c:when>
			<c:otherwise>Le sondage est fermé.
			</c:otherwise>
		</c:choose></td>
	</tr>
</table>
<p><c:url value="/addsondage.htm" var="sondageURL">
	<c:param name="modifier" value="${model.survey.id}" />
</c:url><a href="${sondageURL}"><img
	src='<c:url value="/images/icons/edit.gif" />' /> Modifier les
propriétées</a></p>
<hr />
<c:choose>
	<c:when test="${model.size>0}">
		<h3>Liste des question du sondage</h3>
		<table>
			<tr>
				<th>Titre</th>
				<th>propri&eacute;t&eacute;s</th>
				<th>Type</th>
				<th width="100">Statut</th>
				<th class="th2"></th>
				<th class="th2"></th>
			</tr>
			<c:forEach var="question" items="${model.questions}">
				<tr>
					<td><c:out value="${question.title}" /></td>
					<td><c:choose>
						<c:when test="${question.properties.size() != 0 }">
							<ul>
								<c:forEach var="property" items="${question.properties}">
									<li><c:out value="${property.value}" /></li>
								</c:forEach>
							</ul>
						</c:when>
						<c:otherwise>
							Pas de propri&eacute;t&eacute;s
						</c:otherwise>
					</c:choose></td>
					<td><c:choose>
						<c:when test="${question.type=='STRING'}">
							Phrase
						</c:when>
						<c:when test="${question.type=='TEXT'}">
							Paragraphe
						</c:when>
						<c:when test="${question.type=='FILE'}">
							Fichier joint
						</c:when>
						<c:otherwise>
							Choix multiple
						</c:otherwise>
					</c:choose></td>
					<td><c:choose>
						<c:when test="${question.obligatory==true}">
							Obligatoire
						</c:when>
						<c:otherwise>
							Facultatif
						</c:otherwise>
					</c:choose></td>
					<td><c:url value="/newquestion.htm" var="questionURL">
						<c:param name="modifier" value="${question.id}" />
						<c:param name="surveyFromEdit" value="${model.survey.id}" />
					</c:url> <a href="<c:out value="${questionURL}" escapeXml="true" />"> <img
						src='<c:url value="/images/icons/edit.gif" />' /></a></td>
					<td><a href="#"> <img
						src='<c:url value="/images/icons/cross.png" />' onclick="javascript:if(confirm('Voulez vous confirmer la suppression de la question : <c:out value="${question.title}"/> ?')){location='addquestion.htm?supprimer=<c:out value="${question.id}"/>&amp;surveyFromEdit=<c:out value="${model.survey.id}"/>';return false;}" /> </a></td>
				</tr>
			</c:forEach>

		</table>
	</c:when>
	<c:otherwise>
		<h3>Le sondage ne contient pas encore de questions</h3>
	</c:otherwise>
</c:choose> <c:url value="/newquestion.htm" var="questionURL">
	<c:param name="surveyFromEdit" value="${model.survey.id}" />
</c:url>
<p><a href="${questionURL}"><img
	src='<c:url value="/images/icons/add2.png" />' /> Ajouter une question</a></p>
<hr />
<c:choose>
	<c:when test="${model.numberOfPolled==0}">
		<h3>Aucun sond&eacute; n&acute;est affect&eacute; &agrave; ce
		sondage</h3>
	</c:when>
	<c:otherwise>
		<h3>Le nombre de sond&eacute; : <c:out
			value="${model.numberOfPolled}" /></h3>
		<table>
			<tr>
				<th>Adresse mail</th>
			</tr>
			<c:forEach var="account" items="${model.listAccount}">
				<tr>
					<td><c:out value="${account.mail}" /></td>
				</tr>
			</c:forEach>
		</table>
		<c:if test="${model.emailsExistSize>0}">
			<p>Les emails suivant ont déja une fiche pour ce sondage : <c:forEach
				var="emailExist" items="${model.emailsExist}">
				<c:out value="${emailExist}" />,
	</c:forEach></p>
		</c:if>
	</c:otherwise>
</c:choose>

<c:if test="${model.emailsWrongSize>0}">
	<p>Les emails suivant sont invalident : <c:forEach
		var="emailsWrong" items="${model.emailsWrong}">
		<c:out value="${emailsWrong}" />
	</c:forEach></p>
</c:if>

<c:url value="/newpolled.htm" var="polledURL">
	<c:param name="surveyFromEdit" value="${model.survey.id}" />
</c:url>

<p><a href="${polledURL}"><img
	src='<c:url value="/images/icons/add2.png" />' /> Ajouter un sondé</a></p>
</div>
</div>

<jsp:include page="footer.jsp" /></div>
</body>
</html>